-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Sql] az sql mi start/stop/start-stop-schedule
: Add SQL MI manual and scheduled start stop
#26979
Conversation
️✔️AzureCLI-FullTest
|
Hi @ReneaMoso, |
|
rule | cmd_name | rule_message | suggest_message |
---|---|---|---|
sql mi start | cmd sql mi start added |
||
sql mi start-stop-schedule | sub group sql mi start-stop-schedule added |
||
sql mi stop | cmd sql mi stop added |
az sql |
az sql
] Add SQL MI manual and scheduled start stop
az sql
] Add SQL MI manual and scheduled start stopaz sql mi
: Add SQL MI manual and scheduled start stop
src/azure-cli/azure/cli/command_modules/sql/aaz/latest/sql/mi/_start.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/sql/aaz/latest/sql/mi/_stop.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/sql/aaz/latest/sql/mi/startstopschedule/__cmd_group.py
Outdated
Show resolved
Hide resolved
@AllowLargeResponse() | ||
def test_sql_mi_startstop_mgmt(self): | ||
rg = 'CustomerExperienceTeam_RG' | ||
mi = 'clitestmilb5hsyvgolc22pa3zzf2urno3uwskko4us2mbcti2gebgawczstsm' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the test with ResourceGroupPreparer
and ManagedInstancePreparer
instead of using fixed test resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are having an issue with preparing a Managed Instance, since for this feature we require a Managed Instance on a v2 cluster, and our cluster tries to resize during every MI create, the creation lasts for >3hrs. Due to that, the CLI test that I initially wrote that prepares the MI gets an error about a refused connection:
I'm guessing it happens due to a timeout because creation takes too long. I will be addressing this in the next snap by preparing our test ring to not resize during create, which will shorten the duration of creation time.
az sql mi
: Add SQL MI manual and scheduled start stopaz sql mi start/stop/start-stop-schedule
: Add SQL MI manual and scheduled start stop
…nd scheduled start stop (Azure#26979) * Kerberos win auth initial commit * fixing conflicts * fixing conflicts 2 * generating cmdlets for manual start stop * adding examples for manual start stop * adding scheduled start stop commands except create * adding create command for scheduledstartstop * writing tests * fixing examples, adding tests * test fix * addressing comments --------- Co-authored-by: Renea Moso <a-reneamoso@microsoft.com> Co-authored-by: Renea Moso <reneamoso@microsoft.com>
Related command
In this PR I add new commands for manual and scheduled start stop for Azure SQL Managed Instance. The commands were generated using the CodeGen tool, while tests were manually written.
Description
Here are the new commands with examples:
Manual start stop:
Start a managed instance.
az sql mi start --ids resourceId
az sql mi start --mi miName -g resourceGroup --subscription subscription
Stop a managed instance.
az sql mi stop --ids resourceId
az sql mi stop --mi miName -g resourceGroup --subscription subscription
Scheduled start stop:
Create schedule for managed instance.
az sql mi startstopschedule create --mi miName -g resourceGroup --subscription subscriptionId --schedule-list "[{'startDay':'Monday','startTime':'10:00 AM','stopDay':'Monday','stopTime':'12:00 AM'}]"
Delete a managed instance start stop schedule.
az sql mi startstopschedule delete --ids resourceId
az sql mi startstopschedule delete --mi miName -g resourceGroup --subscription subscriptionId
Lists the managed instance's start stop schedule.
az sql mi startstopschedule list --ids resourceId
az sql mi startstopschedule list --mi miName -g resourceGroup --subscription subscriptionId
Get the managed instance's start stop schedule.
az sql mi startstopschedule show --ids resourceId
az sql mi startstopschedule show --mi miName -g resourceGroup --subscription subscriptionId
Testing Guide
Commands can be tested as shown above in the example.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.